import ACT from '../actionType'

const initState = {
  munberId: null,
  keys: 1
}

export default function reducer(state = initState, { type, payload }) {
  let { data, code, message, success } = payload || {}
  switch (type) {
    case ACT.USER_GET_SUCCESS:
      return {
        ...state,
        keys: data.key
      }
    case ACT.USER_CHANGE:
      return {
        ...state,
        keys: data.key
      }
    default:
      return state
  }
}
